package com.alimama.loganalyzer.jobs.mrs.algo;

public class Normalizer {
	static {
		System.loadLibrary("Normalizer");
	}

	private native String normalize(String words, int options);

	public native void initialize(String confPath);

	public native void unitialize();

	public Normalizer() {
	}

	public String normalize(String words) {
		return normalize(words, 380);
	}
	
	public static void main(String[] args) {
		if(args.length != 1) {
			System.out.println("usage: Normalizer <Word>");
			return;
		}		
		Normalizer norm = new Normalizer();
		norm.initialize("/home/a/share/phoenix/normalize/conf/norm.conf");
		String normalized380 = norm.normalize(args[0], 380);
		String normalized24 = norm.normalize(args[0], 24);

		System.out.println(normalized380);
		System.out.println(normalized24);
		System.out.println(normalized24.equals(normalized380));
	}
}
